<template>
  <div class="company-searcher">
    <div class="mainbody">
      <!-- <van-search v-model="value" @search="onSearch" placeholder="请输入搜索关键词" /> -->
      <van-list
          v-model="loading"
          :finished="finished"
          @load="getList()"
          class="listItems scroll-list">
          <div class="item baItem" v-for="(item, index) in list" :key="index" 
          @click="handleChoose(item)">
            <div class="title">{{item.cateName}}</div>
          </div>
      </van-list>
    </div>
  </div>
</template>
<script>
export default {
  name: "CheckTableSelector",
  components: {
  },
  data () {
    return {
      value: '',
      list: [],
      pagenum: 0,
      loading: false,
      finished: false,
      refreshing: false
    };
  },
  methods: {
    handleChoose: function (item) {
      this.$emit('choosed', item);
    },
    getList () {
      var vm = this;
      vm.list = [];
      vm.finished = false;
      vm.loading = true;
      this.$getAndLoad('检查表列表', 'getCheckListJK.do', function (data) {
        // debugger
        data.data.forEach(n => {
          vm.list.push(n);
        });
        vm.finished = true;
        vm.loading = false;
      });
    }
  },
  mounted: function () {
    // this.getList(1);
  }
};
</script>

<style lang="scss" scoped>
.company-searcher {
  height: 400px;
  position: relative;
  .mainbody {
    height: 400px;
    position: relative;
    .scroll-list {
      height: 400px;
      overflow-y: scroll;
      position: absolute;
      width: 100%;
      top: 0;
      // bottom: 0;
    }
  }
}
.baItem {
  background: #fff;
  padding: 15px 10px 15px;
  position: relative;
  border-bottom: 1px solid #cfcfcf;
  &:nth-child(2n) {
    background: #e9f2e7;
  }
  .title {
    font-weight: bold;
    font-size: 14px;
  }
  .detailBtn {
    position: absolute;
    right: 30px;
    top: 35px;
    background: #093568;
    color: #fff;
    padding: 2px 14px;
    border-radius: 5px;
  }
  .kvs {
    .len {
      display: flex;
      color: #b7b8b9;
      font-size: 12px;
      .k {
        margin-right: 5px;
      }
    }
  }
}
</style>
